package com.ha.controller.user;

import com.ha.entity.Garbage;
import com.ha.result.Result;
import com.ha.service.GarbageService;
import com.ha.vo.GarbageVO;
import com.ha.vo.UserGarbageVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: GarbageController
 * Package: com.ha.controller.user
 * Description:
 *
 * @Author 那啥啥
 * @Create 2024/5/3  15:01
 * @Version 1.0
 */
@RestController("userGarbageController")
@Api(tags = "用户端垃圾接口")
@RequestMapping("/user/garbage")
@Slf4j
public class GarbageController {

    @Autowired
    private GarbageService garbageService;

    @GetMapping
    public Result<List<UserGarbageVO>> getGarbage(String name){

        log.info("查找垃圾：{}",name);
        List<UserGarbageVO> list = garbageService.getByName(name);
        return Result.success(list);

    }

}
